import java.util.Arrays;

public class Test {

    public static void main(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        heap.initElem(array);
        heap.createHeap();
        System.out.println(Arrays.toString(heap.elem));
//        heap.sort();
//        System.out.println(Arrays.toString(heap.elem));
    }


    public static void main5(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        heap.initElem(array);
        heap.createHeap();
        heap.poll();
        System.out.println(Arrays.toString(heap.elem));
    }

    public static void main4(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        for (int i = 0; i < array.length; i++) {
            heap.push(array[i]);
        }
        System.out.println(Arrays.toString(heap.elem));
    }








    public static void main3(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        heap.initElem(array);
        heap.createHeap();
        heap.push(80);
        System.out.println(Arrays.toString(heap.elem));
    }
    public static void main2(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        heap.initElem(array);
        heap.createHeap();
        heap.sort();
        System.out.println(Arrays.toString(heap.elem));
    }
    public static void main1(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37 };
        TestHeap heap = new TestHeap();
        heap.initElem(array);
        heap.createHeap();
        System.out.println(Arrays.toString(heap.elem));
//        heap.push(80);
//        System.out.println(Arrays.toString(heap.elem));
        System.out.println(heap.poll());
        System.out.println(Arrays.toString(heap.elem));

//        for (int i=0;i<array.length;i++){
//            heap.push(array[i]);
//        }
//        System.out.println(Arrays.toString(heap.elem));
//        heap.push(80);
//        System.out.println(Arrays.toString(heap.elem));
//        System.out.println(heap.poll());
//        System.out.println(Arrays.toString(heap.elem));
    }
}
